﻿

using fuzhu;
using GLY_XieTong;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Text;
using System.Threading.Tasks;
using XXX.api.Controllers;
using XXX.api.Log;
using XXX.Bo;
using XXX.Common;
using XXX.Models;
using XXX.Models.XXXEntities;
using XXX.Models.YiJing;

namespace XXX.api.Quarzs
{
    public class UserInfoSyncjob : IJob
    {
        private readonly ILogger<UserInfoSyncjob> _logger;
        //private readonly ILoggerHelper _logger;

        //  private readonly ICache _cache;
        public UserInfoSyncjob(ILogger<UserInfoSyncjob> logger)
        {
            //_cache = cache;
            _logger = logger;
        }
        public Task Execute(IJobExecutionContext context)
        {
            return Task.Run(() =>
                        {
                            Console.Write("开始执行档案定时同步；");
                            // _logger.LogInformation("开始执行档案定时同步");
                            // //同步,取所有的同步
                            // XieTong xieTong = new XieTong(CanShu.conStrInter,"0");
                            //string cRe= xieTong.InsAll("all", "", "");
                            // _logger.LogInformation("同步结果："+cRe);

                            // YiJing2MES yiJing2MES = new YiJing2MES();
                            // yiJing2MES.cVouchType = "all";
                            // yiJing2MES.cOrg = "0";
                            // cRe = PanGuMesService.CheckVouch(yiJing2MES);
                            // _logger.LogInformation("推送MES结果：" + cRe);

                            //定时清理缓存
                            CacheHelpCore.CleanupCache();

                        });
                        
    }
    }
}
